package xcmg.device.dao.mapper.warehouse;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.warehouse.WarehouseDeliveryDetailDO;
import xcmg.device.service.vo.warehouse.WarehouseDeliveryDetailVO;
import xcmg.device.service.vo.warehouse.WarehouseDeliveryVO;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface WarehouseDeliveryDetailMapper {
    int deleteByPrimaryKey(String id);

    int insert(WarehouseDeliveryDetailDO record);

    WarehouseDeliveryDetailDO selectByPrimaryKey(String id);

    WarehouseDeliveryDetailDO itemByMaterialsNo(@Param("orgId")String orgId,@Param("businessOrder")String businessOrder,@Param("materialNo")String materialNo);
    
    List<WarehouseDeliveryDetailDO> itemInfosByMaterialsNo(@Param("orgId")String orgId,@Param("businessOrder")String businessOrder,@Param("materialNo")String materialNo);

    int updateByPrimaryKey(WarehouseDeliveryDetailDO record);

    int deleteByDeliveryOrder(@Param("deliveryOrder") String deliveryOrder, @Param("orgId") String orgId);

    List<WarehouseDeliveryDetailDO> list(WarehouseDeliveryDetailVO model);

    int removeByOutOrderList(@Param("orderList") List<String> orderList, @Param("orgId") String orgId);

    List<WarehouseDeliveryDetailDO> findByBusinessOrder(@Param("businessOrder") String businessOrder, @Param("orgId") String orgId);

    List<WarehouseDeliveryDetailDO> findDetailOrderByLocation(@Param("businessOrder") String businessOrder, @Param("orgId") String orgId);

    BigDecimal findOccupyNum(@Param("materialNo")String materialNo, @Param("orgId")String orgId, @Param("wahouseCode")String wahouseCode);

    int updateStateNoBarcode(@Param("status") Integer status, @Param("businessOrder") String businessOrder, @Param("materialNo")String materialNo , @Param("orgId") String orgId);

    int deleteByMaterial(WarehouseDeliveryDetailDO record);

    int deleteNotComplete(@Param("businessOrder") String businessOrder, @Param("orgId") String orgId);

    int updateAllStatus(@Param("status") Integer status, @Param("billNo") String billNo, @Param("orgId") String orgId);

    int remove(@Param("businessOrder") String businessOrder, @Param("orgId") String orgId,@Param("materialNo") String materialNo);

    List<WarehouseDeliveryDetailDO> findByBusinessOrderForReceipt(@Param("businessOrder") String businessOrder, @Param("orgId") String orgId);

    List<WarehouseDeliveryDetailDO> listReceiptDeliveryNote(@Param("businessOrder") String businessOrder, @Param("materialNo")String materialNo , @Param("orgId") String orgId);

    List<WarehouseDeliveryDetailDO> listReceiptThreeOut(@Param("businessOrder") String businessOrder, @Param("materialNo")String materialNo , @Param("orgId") String orgId);

    List<WarehouseDeliveryDetailDO> listReceiptRegionAllot(@Param("businessOrder") String businessOrder, @Param("materialNo")String materialNo , @Param("orgId") String orgId);

    List<WarehouseDeliveryDetailDO> listReceiptAbnormalOut(@Param("businessOrder") String businessOrder, @Param("materialNo")String materialNo , @Param("orgId") String orgId);

    List<WarehouseDeliveryDetailDO> listByReceiptNo(@Param("billNo") String billNo);

    List<WarehouseDeliveryDetailDO> listForVehicle(WarehouseDeliveryVO model);

    int deleteByBusinessOrder(String businessOrder);

    int deleteByBusinessOrderAndOrgId(@Param("businessOrder") String businessOrder,@Param("orgId") String orgId);
}